package com.uy.system.mapper;

import com.uy.system.model.entity.SysUserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 用户和角色关联表 Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2024-03-22
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {

    /**
     * 删除用户角色信息
     * @param userId 用户id
     */
    @Delete("""
        DELETE FROM sys_user_role WHERE user_id = #{userId}
    """)
    int delSysUserRoleByUserId(@Param("userId") Long userId);
}
